package b3.widget.home.top
{
	import b3.model.*;
	import b3.net.*;
	import b3.scene.home.*;
	import b3.widget.*;
	import b3.widget.basic.*;
	import b3.widget.rank.*;
	
	import flash.events.MouseEvent;
	
	public class RankIcon extends BasicIcon
	{
		public function RankIcon()
		{
			var IconBgr:Class = ResourceHelper.getInstance().getClassByName("RankIcon");
			super(IconBgr, "排行", 1, true);
			addEventListener(MouseEvent.CLICK, onMouseClick);
		}
		
		private function onMouseClick(event:MouseEvent):void
		{
			if (HomeScene.getInstance().getOperationMode() == HomeScene.NONEMODE)
			{
				var rankingDialog:RankingDialog = new RankingDialog();
				rankingDialog.x = -rankingDialog.width / 2;
				rankingDialog.y = -rankingDialog.height / 2;
				WidgetManager.getInstance().popOut([rankingDialog], true);
			}
		}
	}
}